#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <QWidget>
#include <QFile>
#include <QString>
#include <QDebug>
#include <QMessageBox>
#include <QTcpSocket>
#include <QHostAddress>
#include <QLineEdit>
#include <QSizePolicy>

QT_BEGIN_NAMESPACE
namespace Ui { class TcpClient; }
QT_END_NAMESPACE

class TcpClient : public QWidget
{
    Q_OBJECT

public:
    TcpClient(QWidget *parent = nullptr);
    ~TcpClient();
    void loadConfig();
    static TcpClient& getinstance();
    QTcpSocket& getTcpSocket();
//自定义槽函数
public slots:
    void showConnect();
private slots:
    //发送消息槽函数
    //void on_button_sent_clicked();

    void on_button_login_clicked();

    void on_button_regist_clicked();

    void on_button_cancel_clicked();

    void recvmsg();

private:
    Ui::TcpClient *ui;
    QString m_strIP;
    quint16 m_usPort;
    QTcpSocket m_tcpSocket;
};
#endif // TCPCLIENT_H
